package com.example.joke.custom.listview

import android.content.Context
import android.util.AttributeSet
import android.widget.ListView

class CustomListView : ListView {

    constructor(context: Context) : this(
        context,
        null
    )

    constructor(context: Context, attrs : AttributeSet?) : this(
        context,
        attrs,
        0
    )

    constructor(context: Context?, attrs: AttributeSet?, defStyleAttr: Int) : super(
        context,
        attrs,
        defStyleAttr
    )

    override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {
        val expandSpec = MeasureSpec.makeMeasureSpec(
            Int.MAX_VALUE shr 2,
            MeasureSpec.AT_MOST
        )
        super.onMeasure(widthMeasureSpec, expandSpec)
    }


}